﻿using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Text.RegularExpressions;

namespace LabMS.Web.User
{
    /// <summary>
    /// Summary description for $codebehindclassname$
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class CheckPassword : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string psw = context.Request.Params["Password"].ToString();
            string returnvalue;
            if (Regex.IsMatch(psw, @"^\w+$"))
            {
                returnvalue = "\""+psw+"\",true";
            }
            else
            {
                returnvalue = "\""+psw+"\",false";
            }
            context.Response.Write(returnvalue);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
